<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
	<h:head>  
  		
    </h:head> 
	
<h:body>
<ui:composition template="/WEB-INF/templates/templateMain.xhtml">
	<ui:define name="content">
	    <p:panel>
	    <h:form>
	    <h1><h:outputText value="Adicionar Novo Médico"/></h1><br></br>
	    <p:commandButton value="Novo Médico" action="#{medicoBean.manutencaoDeMedicos}" ajax="false"/>
	    
	    <h1><h:outputText value="Listagem De Médicos"/></h1><br></br>
	    
	     <p:dataTable id="pac" var="item" value="#{medicoBean.medicos}" rowKey="#{item.MEDICO_ID}"   
                 selection="#{medicoBean.medicoSelecionado}" selectionMode="single">  
                  <p:column headerText="Nome">  
			           #{item.MEDICO_NOME} 
			        </p:column>  
			        <p:column headerText="Especialidade">  
			          #{item.MEDICO_ESPECIALIDADE}
			        </p:column>  
			        <p:column headerText="CRM">  
			          #{item.MEDICO_CRM}
			        </p:column>  
			  
			        <p:column headerText="Ações" style="width:100px;">  
			            <h:commandLink value="Editar" action="#{medicoBean.manutencaoDeMedicos}">
	    					<f:setPropertyActionListener target="#{medicoBean.medicoSelecionado}" value="#{item}"></f:setPropertyActionListener>
	    				</h:commandLink> 
			        </p:column>  
         </p:dataTable>
	 
		</h:form>
		</p:panel>
	</ui:define>
</ui:composition>
</h:body>
</html>